package com.weibo.common;





import org.apache.log4j.Logger;
import org.springframework.context.support.FileSystemXmlApplicationContext;

public class SpringUtil {
	 
	private static Logger _log = Logger.getLogger(SpringUtil.class);
	
	private static FileSystemXmlApplicationContext _ctx = null;
	/*public static boolean init()
	{
		try {
		_ctx = new FileSystemXmlApplicationContext("conf/beans.xml");
		}catch(Exception e)
		{
			e.printStackTrace();
			return false;
		}
		if(_ctx!=null)
		{
			return true;
		}
		else
		{
			return false;
		}
	}*/
	public static Object getBean(String src,String beanId){
		_ctx = new FileSystemXmlApplicationContext("classpath:"+src);
		_log.debug("spring init successfully.");
		return _ctx.getBean(beanId);
	}
}
